home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1992-02-26 | 1.0 KB | 37 lines |
- ' A Demo to show off Mouse X() and Mouse Y() in a Forbid.
- ' Note: Ctrl+C does not work from a Forbid.
- ' Forbids and Permits stack up so if you have 2 Forbids
- ' You will need to Permits.
-
- Screen Open 0,640,256,4,Hires
- Wait Vbl
-
- ' The Mouse Clip 0 limit the Sticks mouse 0 to the whole screen
- ' if you want it limited to part of a screen you could use
- ' Mouse Clip 0,128,50 to 320,140.
-
- Extension_17_0116 0
- Limit Mouse
- Double Buffer
- FBID=False
- Get Sprite Palette
- Flash Off : Curs Off : Cls 0 : Paper 0
- Centre "Press Left To Forbit & Right To Permit"
- Do
- X= Extension_17_00DA(0) : Y= Extension_17_00F4(0)
- Sprite 1,X,Y,1
- Bob 1,X Screen(X Mouse)+18,Y Screen(Y Mouse),2
- Bob 2,X Screen(X)+18,Y Screen(Y),3
- If Extension_17_011E(0)=1 and FBID=False
- FBID=True
- I=Execall(-132) : Rem Forbid
- Pen 2
- Locate ,2 : Centre "This is a Forbid Situation"
- End If
- If Extension_17_011E(0)=2
- If FBID=True
- I=Execall(-138) : Rem Permit
- End If
- End
- End If
- Loop